package org.yoki.edu.bg.radius.core.raw.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import org.yoki.edu.bg.radius.core.raw.infra.RadNasRepository;
import com.yunzhitx.cloud.common.model.ddd.InstanceFactory;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * 代码生成器自动生成
 * Date:2018-1-3 13:39:27
 * @author
 */
@Data
@Table(name = "radius_rad_nas")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class RadNas implements Serializable{

	private static final long serialVersionUID = 1L;

    /** */
    @Column(name = "id")
    private Integer id;
    /** */
    @Column(name = "nasname")
	private String nasname;
    /** */
    @Column(name = "shortname")
	private String shortname;
    /** */
    @Column(name = "type")
	private String type;
    /** */
    @Column(name = "ports")
	private Integer ports;
    /** */
    @Column(name = "secret")
	private String secret;
    /** */
    @Column(name = "server")
	private String server;
    /** */
    @Column(name = "community")
	private String community;
    /** */
    @Column(name = "description")
	private String description;
	public RadNas(){}

    public RadNas(Integer id){setId(id);}

    private static RadNasRepository radNasRepository;
    public static RadNasRepository getRadNasRepository(){
		if(null==radNasRepository){
			radNasRepository = InstanceFactory.getInstance(RadNasRepository.class);
		}
    	return radNasRepository;
    }

    /**
    * 根据Id，更新RadNas
    *
    * @param
    * @return
    */
    public void update() {
        getRadNasRepository().updateByPrimaryKeySelective(this);
    }

    /**
    * 根据主键ID查询RadNas
    * @param id
    * @return
    */
    /*
    public static RadNasVO selectDetailById(int id) {
        RadNasVO vo = getRadNasRepository().selectDetailById(id);
        return vo;
    }
    */

}